﻿using Kw.Combinatorics;
using System;

namespace Kw.CombinatoricsExamples
{
    class PtExample01
    {
        static void Main ()
        {
            int[] sizes = { 2, 4, 3 };

            var pt = new Product (sizes);

            Console.WriteLine ("Sizes =  { " + String.Join (", ", sizes) + " }\n");

            foreach (var row in pt.GetRows())
                Console.WriteLine ("Rank {0, 2}: {1}", row.Rank, row);
        }

        /* Output:

        Sizes =  { 2, 4, 3 }

        Rank  0: { 0, 0, 0 }
        Rank  1: { 0, 0, 1 }
        Rank  2: { 0, 0, 2 }
        Rank  3: { 0, 1, 0 }
        Rank  4: { 0, 1, 1 }
        Rank  5: { 0, 1, 2 }
        Rank  6: { 0, 2, 0 }
        Rank  7: { 0, 2, 1 }
        Rank  8: { 0, 2, 2 }
        Rank  9: { 0, 3, 0 }
        Rank 10: { 0, 3, 1 }
        Rank 11: { 0, 3, 2 }
        Rank 12: { 1, 0, 0 }
        Rank 13: { 1, 0, 1 }
        Rank 14: { 1, 0, 2 }
        Rank 15: { 1, 1, 0 }
        Rank 16: { 1, 1, 1 }
        Rank 17: { 1, 1, 2 }
        Rank 18: { 1, 2, 0 }
        Rank 19: { 1, 2, 1 }
        Rank 20: { 1, 2, 2 }
        Rank 21: { 1, 3, 0 }
        Rank 22: { 1, 3, 1 }
        Rank 23: { 1, 3, 2 }

        */
    }
}
